/**
 * Copyright(c) 2013-2016 by Puhuifinance Inc.
 * All Rights Reserved
 */
package com.puhui.chome.manager;

import java.util.Date;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.puhui.chome.dao.TemplateDao;
import com.puhui.chome.model.Template;

/**
 * @author dingxingang
 */
@Component
public class TemplateManager {

    @Autowired
    private TemplateDao templateDao;

    /**
     * 添加
     * 
     * @author dingxingang
     * @param template
     */
    public void addTemplate(Template template) {
        template.setCreateTime(new Date());
        template.setUpdateTime(new Date());
        templateDao.addTemplate(template);
    }

    /**
     * 根据ID获取信息
     * 
     * @author dingxingang
     * @param id
     * @return
     */
    public Template getTemplateById(Long id) {
        return templateDao.getTemplateById(id);
    }

    /**
     * 获取总记录数
     * 
     * @author dingxingang
     * @param param
     * @return
     */
    public long findTemplateCount(Map<String, Object> param) {
        return templateDao.findTemplateCount(param);
    }

    /**
     * 查询列表
     * 
     * @author dingxingang
     * @param param
     * @return
     */
    public List<Template> findTemplate(Map<String, Object> param) {
        return templateDao.findTemplate(param);
    }

}
